﻿<%@ Page Language="C#" MasterPageFile="~/Common.Master" AutoEventWireup="true" CodeBehind="share.aspx.cs" Inherits="Pan.share" %>
<%@ MasterType VirtualPath="~/Common.Master" %>

<asp:Content ContentPlaceHolderID="Head" runat="server">
    <link rel="stylesheet" type="text/css" href="/static/css/disk.css" />
    <script src="/static/js/share.js"></script>
    <title>最近分享 - 网盘</title>
</asp:Content>

<asp:Content ContentPlaceHolderID="Content" runat="server">
    <div class="layui-body layui-tab-content main">
        <div class="location">
            <fieldset class="layui-elem-field layui-field-title">
                <legend>分享列表</legend>
            </fieldset>
        </div>
        <div class="bar">
            <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" id="cancel"><i class="layui-icon layui-icon-close"></i>取消分享</button>
        </div>
        <div class="table" runat=server>
            <asp:SqlDataSource ID="SqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:PanConnectionString %>" SelectCommand="GetShareLst" SelectCommandType="StoredProcedure">
                <SelectParameters>
                    <asp:SessionParameter Name="uid" SessionField="uid" Type="Int32" />
                </SelectParameters>
            </asp:SqlDataSource>
            <asp:ListView ID="ShareListView" runat="server" DataKeyNames="id" DataSourceID="SqlDataSource">
                <EmptyDataTemplate>
                    <table id="sharelist" lay-filter="sharelist" style="display: none;">
                            <thead>
                            <tr>
                                <th lay-data="{type:'checkbox', fixed: 'left'}"></th>
                                <th lay-data="{hide: true}"></th>
                                <th lay-data="{width:400}">分享内容</th>
                                <th lay-data="{width:400}">提取码</th>
                                <th lay-data="{width:220}">分享时间</th>
                                <th lay-data="{fixed:'right'}"></th>
                            </tr>
                        </thead>
                    </table>
                </EmptyDataTemplate>
                <ItemTemplate>
                    <tr>
                        <td></td>
                        <td><%# Eval("id") %></td>
                        <td><%# Eval("name") %></td>
                        <td><%# Eval("code") %></td>
                        <td><%# Eval("createTime") %></td>
                        <td></td>
                    </tr>
                </ItemTemplate>
                <LayoutTemplate>
                    <table id="sharelist" lay-filter="sharelist" style="display: none;">
                        <thead>
                            <tr>
                                <th lay-data="{type:'checkbox', fixed: 'left'}"></th>
                                <th lay-data="{field:'id', hide: true}"></th>
                                <th lay-data="{field:'sharecontent', width:400, sort: true}">分享内容</th>
                                <th lay-data="{field:'sharecode', width:400, sort: true}">提取码</th>
                                <th lay-data="{field:'sharetime', width:220, sort: true, align:'center'}">分享时间</th>
                                <th lay-data="{fixed:'right', align:'center', toolbar: '#option'}"></th>
                            </tr>
                        </thead>
                        <script type="text/html" id="option">
                            <a class="layui-btn layui-btn-xs" lay-event="open">打开链接</a>
                            <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="cancel">取消分享</a>
                        </script>
                        <tbody runat="server">
                            <tr id="itemPlaceholder" runat="server"></tr>
                        </tbody>
                    </table>
                </LayoutTemplate>
            </asp:ListView>
            <script>
                layui.use(['table'], function () {
                    var table = layui.table
                    table.init('sharelist', { height: 'full-230', limit: Number.MAX_VALUE });
                })
            </script>
        </div>
    </div>
    <form runat="server" Style="visibility: hidden; width: 0; height: 0;">
        <asp:TextBox ID="Code" runat="server"></asp:TextBox>
        <asp:LinkButton ID="doPost" runat="server" OnClick="doPost_Click"></asp:LinkButton>
    </form>
</asp:Content>
